package com.eric.windows.perference;

import android.os.Bundle;
import android.preference.PreferenceActivity;
import android.widget.Button;

import com.eric.windows.R;

import java.util.List;

public class MyPreferenceActivity extends PreferenceActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        if (hasHeaders()){//设置一个白体按钮
            Button  button = new Button(this);
            button.setText("设置操作");
            setListFooter(button);
        }
    }

    @Override
    public void onBuildHeaders(List<Header> target) {
        super.onBuildHeaders(target);
        loadHeadersFromResource(R.xml.preference_headers,target);
    }


    @Override
    protected boolean isValidFragment (String fragmentName) {
        return true;
    }

}
